<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/html/axios.min.js"></script>
    <script src="/html/util.js"></script>
    <script>
        var info = getQuery("errorLogin");
        window.onload = function (){
            if(info == "no"){
                $("landSpan").innerHTML = "对不起，请先登陆";
            }
        }

        function land(){
            axios.get("/user/login",{
                params:{
                    userName:$("name").value,
                    pwd:$("pwd").value
                }
            }).then(e =>{
                if(e.data == "ok"){
                    location.href = "/html/index.html";
                }
                else{
                    $("landSpan").innerHTML = "登陆失败";
                }
            });
        }
    </script>
</head>
<body>
    <span style="color: red" id="landSpan"></span><br>
    用户名：<input type="text" id="name"><br>
    密码：<input type="password" id="pwd"><br>
    <input type="button" value="提交" onclick="land()">

</body>
</html>